<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件监听</title>
</head>
<body>
<button>按钮</button>
<span>super贝吉塔!</span>
<script>
    var spanE = document.querySelector('span');
    spanE.addEventListener('mouseover',function (){
        console.log("标题被关注了！）")
    })
    var buttonE = document.querySelector('button');
    buttonE.addEventListener("click",function (){
        alert("按钮被点击了!")
    })
    window.addEventListener("scroll",function (){
        console.log("滚动条被滚动了！")
    })
    window.addEventListener("resize",function (){
        console.log("有同学调整窗口大小了！")
    })
</script>
</body>
</html>